using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using NLog;

namespace GameShow.DAL
{
    public class ControlEntertaimentDAL:DALBase       
    {
        private static Logger log = LogManager.GetCurrentClassLogger();

        public void InsertResultEntertaiment(int TeamId, int Minute, int Second)
        {
            SqlCommand command = new SqlCommand();
            try
            {
                command.CommandText = "INSERT INTO tblResultEntertaiment(TeamId, Minute, Second, UpdateTime) " +
                                                    "VALUES (@TeamId, @Minute, @Second, getdate())";

                command.Parameters.Add(new SqlParameter("TeamId", TeamId));
                command.Parameters.Add(new SqlParameter("Minute", Minute));
                command.Parameters.Add(new SqlParameter("Second", Second));


                command.Connection = AppConnection;
                command.ExecuteNonQuery();

            }
            catch (Exception ex)
            {
                log.ErrorException(string.Empty, ex);
            }
            finally
            {
                AppConnection.Close();
            }
        }
    }
}
